//
//  ZhuanFaViewController.m
//  BigJoy
//
//  Created by Rowling on 2017/7/17.
//  Copyright © 2017年 Rowling. All rights reserved.
//

#import "ZhuanFaViewController.h"
#import "DetailImageCell.h"

@interface ZhuanFaViewController ()

@end

@implementation ZhuanFaViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setUI];
}

-(void)setUI {
    UIButton * left = [XMSuperHelper buttonWithTitle:@"取消" Font:[UIFont systemFontOfSize:12] fontColor:[UIColor colorForHex:@"333333"]];
    @weakify(self);
    [[left rac_signalForControlEvents:UIControlEventTouchUpInside] subscribeNext:^(__kindof UIControl * _Nullable x) {
        @strongify(self);
        [self.navigationController popViewControllerAnimated:YES];
    }];
    UIButton * right = [XMSuperHelper buttonWithTitle:@"发送" Font:[UIFont systemFontOfSize:12] fontColor:XMColor(245, 70, 70)];
    self.leftButton = left;
    self.rightButton = right;
    
    //xmtableView
    [self.view addSubview:self.XMTableview];
    UITextView * textView = [[UITextView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 85)];
    self.XMTableview.tableHeaderView = textView;
    self.XMTableview.estimatedRowHeight = 50;
  
}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 10;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    if (indexPath.row == 0) {
        UITableViewCell * cell = [[UITableViewCell alloc]init];
        cell.textLabel.text = @"textLabeltextLabeltextLtextLabeltextLabeltextLabeltextLabeltextLabeltextLabeltextLabeltextLabeltextLabeltextLabeltextLabeltextLabeltextLabeltextLabeltextLabeltextLabeltextLabeltextLabeltextLabeltextLabelabeltextLabeltextLabel";
        cell.textLabel.numberOfLines = 0;
        cell.textLabel.font = [UIFont systemFontOfSize:13];
        cell.textLabel.textColor = [UIColor colorForHex:@"333333"];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        
        UIView * lineView = [UIView new];
        [cell addSubview:lineView];
        [lineView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.right.top.equalTo(cell);
            make.height.equalTo(@1);
        }];
        lineView.backgroundColor = XMColor(221, 221, 221);
        return cell;
    }
    DetailImageCell * cell = [DetailImageCell cellWithTalbelView:tableView];
    return cell;
}

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    return UITableViewAutomaticDimension;
}

@end
